begintownscript;

variables;
short bmessage,rctx,rcty,talk,pcs,seated,timer;
string custom_m;

body;

beginstate INIT_STATE;

	set_name(6,"Hoppston");
	set_char_dialogue_pic(6,1945,0);

	if(get_flag(19,0) == 0){
		force_instant_terrain_redraw();
		if(party_size() == 1)
			message_dialog("_Hey, you!  You don't like a brigand and I could use your help._","Hunh.  This guy has to be for real- if he was a brigand, I'd have been ambushed far too easily before this point.");
		if(party_size() == 2)
			message_dialog("_Hey, you two!  You don't like brigands and I could use your help._","Hunh.  This guy has to be for real- if he was a brigand, we'd have been ambushed far too easily before this point.");
		if(party_size() == 3)
			message_dialog("_Hey, you three!  You don't like brigands and I could use your help._","Hunh.  This guy has to be for real- if he was a brigand, we'd have been ambushed far too easily before this point.");
		if(party_size() == 4)
			message_dialog("_Hey, you four!  You don't like brigands and I could use your help._","Hunh.  This guy has to be for real- if he was a brigand, we'd have been ambushed far too easily before this point.");
		set_flag(19,0,1);
	}

	if(get_flag(19,0) == 2){
		set_terrain(23,16,421);
		erase_char(6);
	}

	timer = 15;

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;

	if(get_flag(19,0) == 2){
		timer = (timer + 1);
		if(timer == 20){
			message_dialog("_Hey!  Take a seat already.  I'm not starting up this boat until you're on board._","Maybe you shouldn't keep Hoppston waiting.");
			timer = 0;
		}
	}

break;

beginstate 10;

	if(get_flag(19,0) == 2){
		pcs = 0;
		seated = 0;
		while(pcs <= 3){
			if(char_ok(pcs) == TRUE){
				set_character_facing(pcs,6);
				if(seated == 0)
					relocate_character(pcs,22,15);
				if(seated == 1)
					relocate_character(pcs,22,17);
				if(seated == 2)
					relocate_character(pcs,21,15);
				if(seated == 3)
					relocate_character(pcs,21,17);
				seated = (seated + 1);
			}

			pcs = (pcs + 1);
		}
		force_view_center(22,15);
		force_instant_terrain_redraw();
		pause(10);

		set_floor(17,16,63);
		force_instant_terrain_redraw();
		play_sound(99);
		pause(3);

		set_floor(18,16,73);
		force_instant_terrain_redraw();
		play_sound(99);
		pause(3);

		set_terrain(24,13,468);
		set_terrain(24,19,468);
		force_instant_terrain_redraw();
		play_sound(79);
		pause(2);

		set_terrain(23,19,337);
		set_terrain(23,13,337);
		force_instant_terrain_redraw();
		play_sound(99);
		pause(2);

		reset_dialog();
		add_dialog_str(0,"Wait a second- the bridge mooring it to the shore is being retracted?  And now, water is beginning to move under the protruding sides of the boat.",0);
		add_dialog_str(1,"_Don't be afraid, this baby works like a charm.  Ten Slayer works in mysterious ways._",0);
		add_dialog_choice(0,"Okay...");
		if(party_size() == 1)
			add_dialog_choice(1,"What the hell kind of boat am I on?!");
		if(party_size() > 1)
			add_dialog_choice(1,"What the hell kind of boat are we on?!");
		bmessage = run_dialog(1);

		if(bmessage == 2)
			message_dialog("Hoppston seems unsurprised.  _Listen, I said to calm down, alright?  It'll get us from this side of the river to the other.  Seriously.  Ten Slayer works, I guarantee you that much._","He had better be right...");

		message_dialog("_Now, I'll need you to fight off the brigands if we encounter any of them.  Understood?  And don't worry if you can't fight 'em, per se.  So long as you can take their sustained fire, that'll be enough for me to get to the other side._","");

		move_to_new_town(2,21,32);
	}

break;

beginstate 11;

	if(in_horse() != -1){
		if(party_size() == 1)
			message_dialog("...am I honestly considering getting on a BOAT with a HORSE?","No, no I'm not.");
		else
			message_dialog("...are we honestly considering getting on a BOAT with a HORSE?","No, no we're not.");
		block_entry(1);
	}

break;

beginstate 30;

	if(party_size() == 1)
		message_dialog("Well, considering that I have no idea how to operate this vehicle...  it would probably be a poor idea to try and pilot it.","");
	if(party_size() > 1)
		message_dialog("Well, considering that we have no idea how to operate this vehicle...  it would probably be a poor idea to try and pilot it.","");

break;

